<?php //pack11class

class ObjectCard extends Module {

    public $object;
    public $label="";
    public $view="";
    public $object_id=0;
    public $traceEnabled=true;

    public function setup() {

        $object=ObjectsManager::getCurrentObject();
        $currency = SettingsManager::getSetting("currency");
        //trace("CURRENCY: ".$currency->value);
        
        $this->label=$object->label;
        $this->object_id=$object->id;
        $cookie=false;
        if(array_key_exists("dekaro".$object->id, $_COOKIE)) $cookie=$_COOKIE["dekaro".$object->id];
        $viewlabel=($cookie)? LabelManager::getLabel("done_preview"):LabelManager::getLabel("ask_preview");
        $this->view=($cookie)? $viewlabel:str_replace('\"', '"', "<a onclick=\"Javascript:PopupManager.open('VisitObjectPopup');\">".$viewlabel."</a>");

        $body=new ObjectCardBody($object);
        $this->addChild($body);
        $this->addChild(new ObjectCardNavigation($object));

    }

}
?>
